<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Memberlogin extends CI_Controller {

    public function __construct() {
        parent::__construct();
    }

    public function index() {
    	
        $data = array();
        $data['template']['content']	= "guest/login";
        $data['template']['nosidebar']	= TRUE;

        $rv		= $this->input->get('rv', TRUE);
        $try	= $this->input->get('try', TRUE);
        
        if($rv) $data['rv'] = $rv;
        
        switch($try) {
        	
        	case '1':
        		$data['err_msg'] = 'reCaptcha yang dimasukkan salah. Silakan ulang kembali.';
        		break;
        	
        	case '2':
        		$data['err_msg'] = 'Format Email salah';
        		break;
        	
        	case '3':
        		$data['err_msg'] = 'Email sudah terdaftar. Silakan masukkan email yang berbeda.';
        		break;
        		
        	case '4':
        		$data['err_msg'] = 'Internal system error. Silakan ulang kembali';
        		break;
        		
        	default:
        		$data['err_msg'] = '';
        }

        $this->load->helper('recaptcha');
        
        $data['captcha'] = recaptcha_get_html(RECAPTCHA_PUBLIC_KEY);

        $this->load->view('essential/template', $data);
    }

}